<template>
	<view class="column-css">
		<!-- <uni-steps
			style="padding-top: 40rpx;"
			activeColor="#2979FF"
			:options="[{ title: '录入个人信息' }, { title: '录入车辆信息' }, { title: '录入收款信息' }]"
			:active="1"
		></uni-steps> -->
		
		<!-- 暂时屏蔽是否牵引车 -->
	<!-- 	<view class="column-css view-cente">
			<view class="row-css view-cente-cle" style="justify-content: space-between;align-items: center;">
				<picker style="width: 100%;" @change="onBindPickerChange" :value="index5" :range="array5">
					<view class="row-css">
						<view class="row-css" style="flex: 1;">
							<view class="view-cente-cle-text">是否牵引车<text style="color: #F36363;">*</text></view>
								<view :style="{ color: license.isTractor == '请选择' ? '#999999' : '#333333' }" v-if="license.isTractor == 0"> 否
									</view>
									<view :style="{ color: license.isTractor == '请选择' ? '#999999' : '#333333' }" v-if="license.isTractor == 1"> 是
										</view>
						</view>
						<view class="row-css" style="align-items: center;">
							<image style="width: 28rpx;height: 28rpx;" src="../../static/icon_enter.png"></image>
						</view>
					</view>
				</picker>
			</view>
		</view> -->
		
		<view class="column-css view-cente-cle" style="margin: 0 30rpx;">
			<view style="font-weight: bold;">请上传行驶证(必填)</view>
			<view class="row-css" style="font-size: 24rpx;color: #333333;">
				<view class="column-css" style="padding-top: 25rpx;text-align: center;">
					<image style="width: 340rpx;height: 230rpx;" mode="aspectFit"
						:src="license.drivingLicense == '' ? modeimage01 : license.drivingLicense"
						@tap="chooseImage(1)"></image>
					<view style="padding-top: 15rpx;">行驶证正页</view>
				</view>
				<view class="column-css" style="padding-top: 25rpx;text-align: center;margin-left: 20rpx;">
					<image style="width: 340rpx;height: 230rpx;" mode="aspectFit"
						:src="license.vehicleLicenseDeputy == '' ? modeimage02 : license.vehicleLicenseDeputy"
						@tap="chooseImage(2)"></image>
					<view style="padding-top: 15rpx;">行驶证副页</view>
				</view>
				<!-- <view class="column-css" style="padding-top: 25rpx;text-align: center;">
					<image
						style="width: 220rpx;height: 230rpx;"
						mode="aspectFit"
						:src="license.rtc == '' ? modeimage : license.rtc"
						@tap="chooseImage(3)"
					></image>
					<view style="padding-top: 15rpx;">道路运输证正面</view>
				</view> -->
			</view>
		</view>
		<!-- <view class="column-css view-cente-cle" style="margin: 0 30rpx;color: #5f6579">
			<view class="row-css" style="font-size: 24rpx;color: #333333;">
				<view class="column-css" style="text-align: center;">
					<image
						style="width: 220rpx;height: 230rpx;"
						mode="aspectFit"
						:src="license.rtcDeputy == '' ? modeimage : license.rtcDeputy"
						@tap="chooseImage(4)"
					></image>
					<view style="padding-top: 15rpx;">道路运输证反面</view>
				</view>
			</view>
		</view> -->
		<view style="font-weight: bold;margin: 0 30rpx;margin-top: 30rpx;">请确定行驶证信息</view>
		<view class="column-css view-cente">
			<!-- <view style="margin-top: 20rpx;padding: 10rpx 0; font-weight: bold;">请确定行驶证信息</view> -->
			<view class="row-css view-cente-cle" style="align-items: center;">
				<view class="view-cente-cle-text">
					车牌号
					<text style="color: #F36363;">*</text>
				</view>
				<view class="" @click="onPlate" style="flex: 1;">
					<input style="flex: 1;" v-model="license._plateNum" disabled="true"
						:placeholder="license.drivingLicense ? '证件识别错误，请手动填写' : '请上传行驶证，系统自动识别'" value="" />
				</view>
					<!-- <input @click="onPlate" style="flex: 1;" v-model="license._plateNum" disabled="true"
						:placeholder="license.drivingLicense ? '证件识别错误，请手动填写' : '请上传行驶证，系统自动识别'" value="" /> -->
			</view>
		</view>
		<!-- 新增挂车信息后屏蔽此功能 -->
				<view class="column-css view-cente">
			<view class="row-css view-cente-cle" style="justify-content: space-between;align-items: center;">
				<picker style="width: 100%;" @change="bindPickerChange3" :value="index3" :range="array3" range-key="dicName">
					<view class="row-css">
						<view class="row-css" style="flex: 1;">
							<view class="view-cente-cle-text">车辆性质<text style="color: #F36363;">*</text></view>
							<view :style="{ color: license.vehicleNature == '请选择' ? '#999999' : '#333333' }">{{ license.vehicleNature }}</view>
						</view>
						<image style="width: 28rpx;height: 28rpx;" src="../../static/icon_enter.png"></image>
					</view>
				</picker>
			</view>
		</view>
		<view class="column-css view-cente">
			<view class="row-css view-cente-cle" style="justify-content: space-between;align-items: center;">
				<picker style="width: 100%;" @change="bindPickerChange1" :value="index1" :range="array1"
					range-key="dicName">
					<view class="row-css">
						<view class="row-css" style="flex: 1;">
							<view class="view-cente-cle-text">车牌颜色<text style="color: #F36363;">*</text></view>
							<view :style="{ color: license.plateColour == '请选择' ? '#999999' : '#333333' }">
								{{ license.plateColour }}</view>
						</view>
						<view class="row-css" style="align-items: center;">
							<image style="width: 28rpx;height: 28rpx;" src="../../static/icon_enter.png"></image>
						</view>
					</view>
				</picker>
			</view>
		</view>

        <!-- 此功能暂时屏蔽 -->
	<!-- 	<view class="column-css view-cente">
			<view class="row-css view-cente-cle" style="justify-content: space-between;align-items: center;">
				<picker style="width: 100%;" @change="bindDateChange" mode="date"
					:end="endDate">
					<view class="row-css">
						<view class="row-css" style="flex: 1;">
							<view class="view-cente-cle-text">强制报废期<text style="color: #F36363;">*</text></view>
							<view :style="{ color: license.validPeriod == '请选择' ? '#999999' : '#333333' }">
								{{ license.validPeriod }}</view>
						</view>
						<view class="row-css" style="align-items: center;">
							<image style="width: 28rpx;height: 28rpx;" src="../../static/icon_enter.png"></image>
						</view>
					</view>
				</picker>
			</view>
		</view> -->
		
		<!-- 排放标准 此处暂时屏蔽-->
<!-- 		<view class="column-css view-cente">
			<view class="row-css view-cente-cle" style="justify-content: space-between;align-items: center;">
				<picker style="width: 100%;" @change="bindPickerChange9" :value="index9" :range="array9"
					range-key="dicName">
					<view class="row-css">
						<view class="row-css" style="flex: 1;">
							<view class="view-cente-cle-text">排放标准</view>
							<view :style="{ color: license.emissionStandard == '请选择' ? '#999999' : '#333333' }">
								{{ license.emissionStandard }}</view>
						</view>
						<view class="row-css" style="align-items: center;">
							<image style="width: 28rpx;height: 28rpx;" src="../../static/icon_enter.png"></image>
						</view>
					</view>
				</picker>
			</view>
		</view> -->
		
		
		<view class="column-css">
			<view style="width: 100%; height: 20rpx;background: #F1F1F1;margin: 20rpx 0pt;"></view>
			<view class="row-css" style="padding-left: 20rpx;">
				<!-- <view class="column-css" style="width: 8rpx;background: #2979ff;margin: 5rpx 10rpx;"></view> -->
				<view style="font-weight: bold;">请上传道路运输证(必填)</view>
			</view>
			<view style="color:#2979ff;font-size: 24rpx;margin: 5rpx 20rpx;">4.5吨以上车辆请上传道路运输许可证照片</view>
			<view class="column-css view-cente-cle" style="margin: 0 30rpx;">
				<view class="row-css" style="font-size: 24rpx;color: #333333;">
					<view class="column-css" style="padding-top: 25rpx;text-align: center;">
						<image style="width: 340rpx;height: 230rpx;" mode="aspectFit"
							:src="license.rtc == '' ? modeimage03 : license.rtc" @tap="chooseImage(3)"></image>
						<view style="padding-top: 15rpx;">道路运输证正页</view>
					</view>
					<view class="column-css"
						style="padding-top: 25rpx;text-align: center;margin-left: 20rpx;display: none;">
						<image style="width: 340rpx;height: 230rpx;" mode="aspectFit"
							:src="license.rtcDeputy == '' ? modeimage03 : license.rtcDeputy" @tap="chooseImage(4)">
						</image>
						<view style="padding-top: 15rpx;">道路运输证副页</view>
					</view>
				</view>
			</view>
			<view class="column-css view-cente" style="margin-bottom: 20rpx;">
				<view class="row-css view-cente-cle" style="align-items: center;">
					<view class="view-cente-cle-text">
						道路运输证号
						<text v-if='license.weightFlag' style="color: #F36363;">*</text>
					</view>
					<input style="flex: 1;" type="number" v-model="license._rtcNo" placeholder="请上传道路运输证，系统自动识别"
						value="" />
				</view>
			</view>
			<view class="column-css" v-if="license.tqcFlag == true">
				<view style="width: 100%; height: 20rpx;background: #F1F1F1;margin: 20rpx 0pt;"></view>
				<view class="row-css" style="padding-left: 20rpx;">
					<!-- <view class="column-css" style="width: 8rpx;background: #2979ff;margin: 5rpx 10rpx;"></view> -->
					<view style="font-weight: bold;">请上传本人有效从业资格证(必填)</view>
					
				</view>
				<view style="color: #2979ff;font-size: 24rpx;margin: 5rpx 20rpx;">4.5吨以上车辆请上传司机从业资格证照片</view>
				<view class="column-css view-cente-cle" style="margin: 0 30rpx;">
					<view class="row-css" style="font-size: 24rpx;color: #333333;">
						<view class="column-css" style="padding-top: 25rpx;text-align: center;">
							<image style="width: 340rpx;height: 230rpx;" mode="aspectFit"
								:src="license.tqc == '' ? modeimage04 : license.tqc" @tap="chooseImage(5)"></image>
							<view style="padding-top: 15rpx;">从业资格证正页</view>
						</view>
						<view class="column-css" style="padding-top: 25rpx;text-align: center;display: none;">
							<image style="width: 340rpx;height: 230rpx;" mode="aspectFit"
								:src="license.tqcDeputy == '' ? modeimage04 : license.tqcDeputy" @tap="chooseImage(6)">
							</image>
							<view style="padding-top: 15rpx;">从业资格证副页</view>
						</view>
					</view>
				</view>
				<view style="font-size: 24rpx;padding: 20rpx;">温馨提示：根据交通运输部关于网络货运的监督要求，我们需要您提供真实的身份信息进行司机身份的认证</view>
				<view style="width: 100%; height: 20rpx;background: #F1F1F1;margin-bottom: 20rpx;"></view>
			</view>
		</view>
		<view class="column-css view-cente-cle" style="margin: 0 30rpx;">
			<view style="font-weight: bold;">请上传交强险保险单(必填)</view>
			<view class="row-css" style="font-size: 24rpx;color: #333333;">
				<view class="column-css" style="padding-top: 25rpx;text-align: center;">
					<image style="width: 340rpx;height: 230rpx;" mode="aspectFit"
						:src="license.insuranceUrl == '' ? modeimage09 : license.insuranceUrl" @tap="chooseImage(9)">
					</image>
				</view>
			</view>
		</view>
		<!--上传挂车信息  暂时屏蔽 -->
		<!-- 	<view v-if="index5 == 1 || license.isTractor == 1">
			<view class="column-css view-cente-cle" style="margin: 0 30rpx;">
				<view style="font-weight: bold;">请上传挂车行驶证(必填)</view>
				<view class="row-css" style="font-size: 24rpx;color: #333333;">
					<view class="column-css" style="padding-top: 25rpx;text-align: center;">
						<image style="width: 340rpx;height: 230rpx;" mode="aspectFit"
							:src="license.trailerInfo.pictureImg == '' ? modeimage01 : license.trailerInfo.pictureImg" @tap="chooseImage(7)">
						</image>
						<view style="padding-top: 15rpx;">挂车行驶证正页</view>
					</view>
					<view class="column-css" style="padding-top: 25rpx;text-align: center;margin-left: 20rpx;">
						<image style="width: 340rpx;height: 230rpx;" mode="aspectFit"
							:src="license.trailerInfo.pictureImgDeputy == '' ? modeimage02 : license.trailerInfo.pictureImgDeputy"
							@tap="chooseImage(8)"></image>
						<view style="padding-top: 15rpx;">挂车行驶证副页</view>
					</view>
				</view>
			</view>

			<view style="font-weight: bold;margin: 0 30rpx;margin-top: 30rpx;">请确定挂车行驶证信息</view>
			<view class="column-css view-cente">
				<view class="row-css view-cente-cle" style="align-items: center;">
					<view class="view-cente-cle-text">
						车牌号
						<text style="color: #F36363;">*</text>
					</view>
						<input @click="onHandcar" style="flex: 1;" v-model="license.trailerInfo.plateNumOcr" disabled="true"
							:placeholder="license.trailerInfo.pictureImg ? '证件识别错误，请手动填写' : '请上传行驶证，系统自动识别'" value="" />
				</view>
			</view>

		</view> -->



		<!-- <view class="column-css" v-if="license.weightFlag == true"> -->


		<!-- <view class="column-css view-cente">
			<view class="row-css view-cente-cle" style="justify-content: space-between;align-items: center;">
				<view class="row-css" style="flex: 1;">
					<view class="view-cente-cle-text">车辆颜色</view>
					<picker style="flex: 1;" @change="bindPickerChange2" :value="index2" :range="array2" range-key="dicName">
						<view>{{ license.vehicleColour }}</view>
					</picker>
				</view>
				<image style="width: 28rpx;height: 28rpx;" src="../../static/icon_enter.png"></image>
			</view>
		</view>
		<view class="column-css view-cente">
			<view class="row-css view-cente-cle">
				<view class="view-cente-cle-text">使用性质</view>
				<view>{{ license.natureUse }}</view>
			</view>
		</view>
		<view class="column-css view-cente">
			<view class="row-css view-cente-cle" style="justify-content: space-between;align-items: center;">
				<view class="row-css">
					<view class="view-cente-cle-text">
						车辆长度
						<text style="color: #F36363;">*</text>
					</view>
					<input v-model="license.length" disabled="true" placeholder="请上传行驶证，系统自动识别" value="" />
				</view>
				<view>mm</view>
			</view>
		</view>
		<view class="column-css view-cente">
			<view class="row-css view-cente-cle" style="justify-content: space-between;align-items: center;">
				<view class="row-css">
					<view class="view-cente-cle-text">
						车辆宽度
						<text style="color: #F36363;">*</text>
					</view>
					<input v-model="license.width" disabled="true" placeholder="请上传行驶证，系统自动识别" value="" />
				</view>
				<view>mm</view>
			</view>
		</view>
		<view class="column-css view-cente">
			<view class="row-css view-cente-cle" style="justify-content: space-between;align-items: center;">
				<view class="row-css">
					<view class="view-cente-cle-text">
						车辆高度
						<text style="color: #F36363;">*</text>
					</view>
					<input v-model="license.high" disabled="true" placeholder="请上传行驶证，系统自动识别" value="" />
				</view>
				<view>mm</view>
			</view>
		</view>
		<view class="column-css view-cente">
			<view class="row-css view-cente-cle" style="justify-content: space-between;align-items: center;">
				<view class="row-css" style="flex: 1;">
					<view class="view-cente-cle-text">车辆类型</view>
					<picker style="flex: 1;" mode="multiSelector" @columnchange="bindMultiPickerColumnChange" :value="multiIndex" :range="multiArray" range-key="dicName">
						<view>{{ license.vehicleType }}</view>
					</picker>
				</view>
				<image style="width: 28rpx;height: 28rpx;" src="../../static/icon_enter.png"></image>
			</view>
		</view>

		<view class="column-css view-cente">
			<view class="row-css view-cente-cle" style="justify-content: space-between;align-items: center;">
				<view class="row-css" style="flex: 1;">
					<view class="view-cente-cle-text">车轴</view>
					<picker style="flex: 1;" @change="bindPickerChange" :value="index" :range="array" range-key="dicName">
						<view>{{ license.axle }}</view>
					</picker>
				</view>
				<image style="width: 28rpx;height: 28rpx;" src="../../static/icon_enter.png"></image>
			</view>
		</view>
		<view class="column-css view-cente">
			<view class="row-css view-cente-cle">
				<view class="view-cente-cle-text">
					车辆品牌
					<text style="color: #F36363;">*</text>
				</view>
				<input v-model="license.vehicleBrand" disabled="true" placeholder="请上传行驶证，系统自动识别" value="" />
			</view>
		</view>
		<view class="column-css view-cente">
			<view class="row-css view-cente-cle">
				<view class="view-cente-cle-text">
					检验有效期
					<text style="color: #F36363;">*</text>
				</view>
				<input v-model="license.validPeriod" disabled="true" placeholder="请上传行驶证，系统自动识别" value="" />
			</view>
		</view>
		<view class="column-css view-cente">
			<view class="row-css view-cente-cle" style="justify-content: space-between;align-items: center;">
				<view class="row-css">
					<view class="view-cente-cle-text">
						吨位
						<text style="color: #F36363;">*</text>
					</view>
					<input v-model="license.tonnage" disabled="true" placeholder="请上传行驶证，系统自动识别" value="" />
				</view>
				<view>吨</view>
			</view>
		</view>
		<view class="column-css view-cente">
			<view class="row-css view-cente-cle" style="justify-content: space-between;align-items: center;">
				<view class="row-css">
					<view class="view-cente-cle-text">
						核定载重量
						<text style="color: #F36363;">*</text>
					</view>
					<input v-model="license.approvedLoad" disabled="true" placeholder="请上传行驶证，系统自动识别" value="" />
				</view>
				<view>吨</view>
			</view>
		</view> -->
		<view class="view-button" @click="onnext()">提交审核</view>


		<plate-input v-if="plateShow" :plate="license._plateNum" @export="setPlate" @close="plateShow=false" />

        <plate-input v-if="isplateShow" :plate="license.plateNumOrc" @export="catPlate" @close="isplateShow=false" />

		<uni-popup ref="popup" type="bottom" mask-background-color="rgba(0,0,0,0.8)">
			<view class="popup-wrap">
				<view class="popup-describe">
					<image v-if="selindex == 1" src="../../static/icon_example_car03.png" mode="aspectFit"></image>
					<image v-if="selindex == 2" src="../../static/icon_example_car04.png" mode="aspectFit"></image>
					<image v-if="selindex == 3" src="../../static/icon_example_road.png" mode="aspectFit"></image>
					<image v-if="selindex == 5" src="../../static/icon_example_bus.png" mode="aspectFit"></image>
					<image v-if="selindex == 7" src="../../static/icon_example_car03.png" mode="aspectFit"></image>
					<image v-if="selindex == 8" src="../../static/icon_example_car04.png" mode="aspectFit"></image>
					<image v-if="selindex == 9" src="../../static/icon_example_insurance.png" mode="aspectFit"></image>
					<view>
						<view class="title">{{title}}</view>
						<view class="desc">
							<view>保证证件四角可见，无遮挡，无反光；</view>
							<view>{{desc}}</view>
						</view>
					</view>
				</view>
				<view class="popup-box">
					<view @click="onCamera(0)">拍照</view>
					<view @click="onCamera(1)">从相册选择</view>
				</view>
				<view class="popup-cancel" @click="onCancel">取消</view>
			</view>
		</uni-popup>
		<!-- <view class="sameShow" v-show="sameShow">
			车辆所有人企业与当前委托方企业一致，无法在当前企业新增！
		</view> -->
	</view>
</template>

<script>
	import plateInput from '@/components/uni-plate-input/uni-plate-input.vue'
	export default {
		data() {
			const currentDate = this.getDate({
				format: true
			})

			return {
				modeimage01: '../../static/icon_carmer07.png',
				modeimage02: '../../static/icon_carmer08.png',
				modeimage03: '../../static/icon_carmer06.png',
				modeimage04: '../../static/icon_carmer05.png',
				modeimage09: '../../static/icon_carmer09.png',
				// sameShow: false,
				license: {
					drivingLicense: '',
					rtc: '',
					vehicleLicenseDeputy: '',
					rtcDeputy: '',
					tqc: '',
					tqcDeputy: '',
					plateColour: '请选择',
					vehicleColour: '黑',
					vehicleNature: '请选择',
					vehicleType: '半挂车 厢式',
					axle: 2,
					tractorType: '半挂车',
					vanType: '厢式',
					tractorType: '01',
					emissionStandard: '请选择',
				
					vanType: '01',
					// #ifdef MP-WEIXIN
					clickLocation: "2",
					// #endif
					// #ifdef APP-PLUS
					clickLocation: "1",
					// #endif
					isTractor: "",
                    trailerInfo:{
						pictureImg: "", //牵引车正页
						pictureImgDeputy: "", //牵引车副页
						plateNum:"",  //车牌号
						plateNumOcr:"",  //车牌号ORC识别
						plateColour:"",  //车牌颜色
						vehicleColour:"",  //车辆颜色
						vanType:"",  //车辆类型
						validPeriod: "", //挂车有效期
						validPeriodOcr: "", //挂车有效期OCR
						axle: "", //车轴
					    length: "", //车长
						width: "", //车宽
						high: "", //车高
						natureUse: "", //使用性质
						owner: "", //所有人
						vehicleEnergyType: "", //车辆能源
						issuingOrganizations: "", //发证机关
						registerDate: "", //注册日期
						vin: "", //车辆识别代号
						issueDate: "", //发证日期
						vehicleBrand: "", //车辆品牌
						fileNo: "", //行驶证档案编号
						pictureImgFlag: "", //挂车图片是否异常 0.正常 1.异常
						pictureImgDeputyFlag:"", //挂车副图片是否异常 0.正常 1.异常
						pictureImgMsg: "", //挂车正面报错信息
						pictureImgDeputyMsg: "" ,//挂车副页报错信息
						isTractor:""
					},
					validPeriod:"请选择",  //强制报废日期
					
					insuranceUrl: "", //保险文件
				},
				index9: 0,
				array9: [],
				vehicleId: '',
				userInfo: {},
				payeeName: '',
				payeeIdcardNo: '',
				multiIndex: [0, 0],
				multiArray: [],
				array: [],
				index: 0,
				array1: [],
				index1: 0,
				array2: [],
				index2: 0,
				array3: [],
				index3: 0,
				index5: 0,
				array5: ["否", "是"],

				data: "currentDate",
				plateShow: false,
				selindex: null,
				title: '',
				desc: '',
				isplateShow:false
			};
		},
		components: {
			plateInput
		},
		methods: {
			setPlate(plate) {
		 	if (plate.length >= 7) this.license._plateNum = plate
				this.plateShow = false
			},
			catPlate(plate){
				if (plate.length >= 7) this.license.trailerInfo.plateNumOcr = plate
					this.isplateShow = false
				},
			
			onPlate() {
				if (!this.license.drivingLicense) {
					return
				}
				this.plateShow = true
			},
			onHandcar(){
				if(!this.license.trailerInfo.pictureImg){
					return
				}
				this.isplateShow =true
			},
			bindMultiPickerColumnChange: function(e) {
				this.multiIndex[e.detail.column] = e.detail.value;
				// switch (e.detail.column) {
				// 	case 0: //拖动第1列
				// 		switch (this.multiIndex[0]) {
				// 			case 0:
				// 				this.multiArray[1] = ['北京', '上海', '广州'];
				// 				break;
				// 			case 1:
				// 				this.multiArray[1] = ['东京', '北海道'];
				// 				break;
				// 		}
				// 		break;
				// }
				this.license.tractorType = this.multiArray[0][this.multiIndex[0]].dicValue;
				this.license.vanType = this.multiArray[1][this.multiIndex[1]].dicValue;
				this.license.vehicleType = this.multiArray[0][this.multiIndex[0]].dicName + ' ' + this.multiArray[1][this.multiIndex[1]].dicName;
				this.$forceUpdate();
			},
			bindPickerChange: function(e) {
				this.index = e.target.value;
				this.license.axle = this.array[this.index].dicName;
			},
			bindPickerChange1: function(e) {
				this.index1 = e.target.value;
				this.license.plateColour = this.array1[this.index1].dicName;
			},
			bindPickerChange2: function(e) {
				this.index2 = e.target.value;
				this.license.vehicleColour = this.array2[this.index2].dicName;
			},
			bindPickerChange3: function(e) {
				this.index3 = e.target.value;

				this.license.vehicleNature = this.array3[this.index3].dicName;
				console.log(this.license.vehicleNature, this.index3)
			},
			bindPickerChange9: function(e) {
				this.index9 = e.target.value;

				this.license.emissionStandard = this.array9[this.index9].dicName;
			},

			chooseImage: async function(index) {
				this.selindex = index
				this.$refs.popup.open()
				if (this.selindex == 1) {
					this.title = '请上传车辆行驶证正页照片'
					this.desc = '号码号牌、车辆类型等信息，文字清晰可辩'
				} else if (this.selindex == 2) {
					this.title = '请上传车辆行驶证副页照片'
					this.desc = '号码号牌、车辆类型等信息，文字清晰可辩'
				} else if (this.selindex == 3) {
					this.title = '请上传道路运输证照片'
					this.desc = '运输证号等信息，文字清晰可辩'
				} else if (this.selindex == 7) {
					this.title = '请上传牵引车正页照片'
					this.desc = '号码号牌、车辆类型等信息，文字清晰可辩'
				} else if (this.selindex == 8) {
					this.title = '请上传牵引车正页照片'
					this.desc = '号码号牌、车辆类型等信息，文字清晰可辩'
				} else if (this.selindex == 5){
					this.title = '请上传从业资格证照片'
					this.desc = '从业资格证等信息，文字清晰可辩'
				} else if (this.selindex == 9) {
					this.title = '请上传交强险图片'
					this.desc = '交强险等信息，文字清晰可辩'
				}
				
				return
				// TODO 选择相机或相册时 需要弹出actionsheet，目前无法获得是相机还是相册，在失败回调中处理
				uni.chooseImage({
					count: 1,
					sizeType: 'compressed',
					success: res => {
						uni.showLoading({
							title: '上传中'
						});
						if (index == 1) {
							uni.uploadFile({
								url: `${this.API}/driverService/upload_driving_license`,
								fileType: 'image',
								name: 'file',
								filePath: res.tempFilePaths[0],
								file: res.tempFiles,
								header: {
									'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
									Authorization: uni.getStorageSync(this.DATA_KEY.token)
								},
								formData: {
									fileType: '6',
									phoneNumber: this.userInfo.phoneNumber,
									fileId: Math.floor(Math.random() * 1259),
									ocrOrNot: '1',
									orderId: ''
								},
								success: res => {
									uni.hideLoading();
									console.log('行驶证正面: ', JSON.parse(res.data));

									if (JSON.parse(res.data).code == 0) {
										this.license.drivingLicense = JSON.parse(res.data).data.imgurl;
										this.license.natureUse = JSON.parse(res.data).data.natureUse;
										this.license._plateNum = JSON.parse(res.data).data.plateNum;
										this.license.plateNum = JSON.parse(res.data).data.plateNum;
										this.license.vehicleBrand = JSON.parse(res.data).data.vehicleBrand;
										this.license.registerDate = this.fordata(JSON.parse(res.data).data.registerDate);
										this.license.vin = JSON.parse(res.data).data.vin;
										this.license.issueDate = this.fordata(JSON.parse(res.data).data.issueDate);
										this.license.owner = JSON.parse(res.data).data.owner;
										this.license.issuingOrganizations = JSON.parse(res.data).data.issuingOrganizations;
										this.license.area = JSON.parse(res.data).data.area;
										this.license.type = JSON.parse(res.data).data.type;
										this.license.uploadDrivingLicenseFlag = JSON.parse(res.data).data.uploadDrivingLicenseFlag;
										this.license.uploadDrivingLicenseMsg = JSON.parse(res.data).data.uploadDrivingLicenseMsg;
										console.log(this.license.plateNum,"this.license.plateNum")
										
										//isTractor车辆类型 1.非牵引车 2.牵引车 3.挂车
										this.license.isTractor = JSON.parse(res.data).data.isTractor;
										// 暂时屏蔽此区域挂车功能判断
										// if(this.license.isTractor == 2){
										// 	uni.showModal({
										// 		content:"系统检测到该证件为挂车行驶证，请问是否切换到挂车证件上传",
										// 		success: (res) => {
										// 			if(res.confirm){
										// 				this.license.isTractor = 1;
										// 				this.license.trailerInfo.pictureImg =this.license.drivingLicense  //挂车行驶证正页
										// 				this.license.trailerInfo.natureUse = this.license.natureUse   //使用性质
										// 				this.license.trailerInfo.plateNumOcr = this.license._plateNum  //车牌ORC
										// 				this.license.trailerInfo.plateNum = this.license.plateNum  //车牌号														this.license.trailerInfo.vehicleBrand =this.license.vehicleBrand  //车辆品牌
										// 				this.license.trailerInfo.registerDate = this.license.registerDate  //注册日期
										// 				this.license.trailerInfo.vin =this.license.vin  //车辆识别代码
										// 				this.license.trailerInfo.issueDate = this.license.issueDate  //发证日期
										// 				this.license.trailerInfo.owner = this.license.owner//所有人
										// 				this.license.trailerInfo.issuingOrganizations = this.license.issuingOrganizations//发证机关
										// 				this.license.trailerInfo.pictureImgFlag = this.license.uploadDrivingLicenseFlag  //挂车正页是否正常  0正常 1异常
										// 				this.license.trailerInfo.pictureImgMsg = this.license.uploadDrivingLicenseMsg;  //挂车正页报错信息
										// 				//重置行驶证信息
										// 				this.license.drivingLicense = this.modeimage01;
										// 				this.license._plateNum='请选择';
										// 			}else if(res.cancel){
										// 				this.license.isTractor = 0;
										// 			}
										// 		}
										// 	})
										// }
											
										//isTractorOcr车辆类型OCR识别  1.非牵引车 2.牵引车 3.挂车
										this.license.isTractoOrc = JSON.parse(res.data).data.isTractoOrc;
											

									} else {
										uni.showToast({
											title: JSON.parse(res.data).msg,
											icon: 'none'
										});
									}
								},
								fail: error => {
									uni.showToast({
										title: '文件上传失败',
										icon: 'none'
									});
								}
							});
						} else if (index == 2) {
							uni.uploadFile({
								url: `${this.API}/driverService/upload_driving_license_deputy`,
								fileType: 'image',
								name: 'file',
								filePath: res.tempFilePaths[0],
								file: res.tempFiles,
								header: {
									'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
									Authorization: uni.getStorageSync(this.DATA_KEY.token)
								},
								formData: {
									fileType: '6',
									phoneNumber: this.userInfo.phoneNumber,
									fileId: Math.floor(Math.random() * 1259),
									ocrOrNot: '1',
									orderId: ''
								},
								success: res => {
									uni.hideLoading();
									console.log('行驶证副页: ', JSON.parse(res.data));
									if (JSON.parse(res.data).code == 0) {
										this.license.vehicleLicenseDeputy = JSON.parse(res.data).data.imgurl;
										this.license.plateNumOcrDrivingPermit = JSON.parse(res.data).data.plateNumOcrDrivingPermit;
										this.license.tonnage = JSON.parse(res.data).data.tonnage;
										this.license.approvedLoad = JSON.parse(res.data).data.approvedLoad;
										this.license.length = JSON.parse(res.data).data.length;
										this.license.width = JSON.parse(res.data).data.width;
										this.license.high = JSON.parse(res.data).data.high;
										this.license.validPeriod = this.fordata(JSON.parse(res.data).data.validPeriod);
										this.license.vehicleEnergyType = JSON.parse(res.data).data.vehicleEnergyType;
										this.license.curbWeight = JSON.parse(res.data).data.curbWeight;
										this.license.quasiTraction = JSON.parse(res.data).data.quasiTraction;
										this.license.fileNo = JSON.parse(res.data).data.fileNo;
										this.license.weightFlag = JSON.parse(res.data).data.weightFlag;
										this.license.tqcFlag = JSON.parse(res.data).data.tqcFlag;
										this.license.uploadDrivingLicenseDeputyFlag = JSON.parse(res.data).data.uploadDrivingLicenseDeputyFlag;
										this.license.uploadDrivingLicenseDeputyMsg = JSON.parse(res.data).data.uploadDrivingLicenseDeputyMsg;
									} else {
										uni.showToast({
											title: JSON.parse(res.data).msg,
											icon: 'none'
										});
									}
								},
								fail: error => {
									uni.showToast({
										title: '文件上传失败',
										icon: 'none'
									});
								}
							});
						} else if (index == 3) {
							uni.uploadFile({
								url: `${this.API}/driverService/uploadRtc`,
								fileType: 'image',
								name: 'file',
								filePath: res.tempFilePaths[0],
								file: res.tempFiles,
								header: {
									'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
									Authorization: uni.getStorageSync(this.DATA_KEY.token)
								},
								formData: {
									fileType: '6',
									phoneNumber: this.userInfo.phoneNumber,
									fileId: Math.floor(Math.random() * 1259),
									ocrOrNot: '1',
									orderId: ''
								},
								success: res => {
									uni.hideLoading();
									console.log('道路运输证: ', JSON.parse(res.data));
									if (JSON.parse(res.data).code == 0) {
										this.license.rtc = JSON.parse(res.data).data.imgurl;
										this.license._rtcNo = JSON.parse(res.data).data.rtcNo;
										this.license.rtcNo = JSON.parse(res.data).data.rtcNo;
										this.license.uploadRtcFlag = JSON.parse(res.data).data.uploadRtcFlag;
										this.license.uploadRtcMsg = JSON.parse(res.data).data.uploadRtcMsg;
									} else {
										uni.showToast({
											title: JSON.parse(res.data).msg,
											icon: 'none'
										});
									}
								},
								fail: error => {
									uni.showToast({
										title: '文件上传失败',
										icon: 'none'
									});
								}
							});
						} else if (index == 4) {
							uni.uploadFile({
								url: `${this.API}/driverService/upload`,
								fileType: 'image',
								name: 'file',
								filePath: res.tempFilePaths[0],
								file: res.tempFiles,
								header: {
									'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
									Authorization: uni.getStorageSync(this.DATA_KEY.token)
								},
								formData: {
									fileType: '6',
									phoneNumber: this.userInfo.phoneNumber,
									fileId: Math.floor(Math.random() * 1259),
									ocrOrNot: '1',
									orderId: ''
								},
								success: res => {
									uni.hideLoading();
									console.log('道路运输证: ', JSON.parse(res.data));
									if (JSON.parse(res.data).code == 0) {
										this.license.rtcDeputy = JSON.parse(res.data).data;
									} else {
										uni.showToast({
											title: JSON.parse(res.data).msg,
											icon: 'none'
										});
									}
								},
								fail: error => {
									uni.showToast({
										title: '文件上传失败',
										icon: 'none'
									});
								}
							});
						} else if (index == 5) {
							uni.uploadFile({
								url: `${this.API}/driverService/uploadTqc`,
								fileType: 'image',
								name: 'file',
								filePath: res.tempFilePaths[0],
								file: res.tempFiles,
								header: {
									'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
									Authorization: uni.getStorageSync(this.DATA_KEY.token)
								},
								formData: {
									fileType: '6',
									phoneNumber: this.userInfo.phoneNumber,
									fileId: Math.floor(Math.random() * 1259),
									ocrOrNot: '1',
									orderId: ''
								},
								success: res => {
									uni.hideLoading();
									console.log('从业资格证: ', JSON.parse(res.data));
									if (JSON.parse(res.data).code == 0) {
										this.license.tqc = JSON.parse(res.data).data.imgurl;
										this.license.tqcNo = JSON.parse(res.data).data.tqcNo;
									} else {
										uni.showToast({
											title: JSON.parse(res.data).msg,
											icon: 'none'
										});
									}
								},
								fail: error => {
									uni.showToast({
										title: '文件上传失败',
										icon: 'none'
									});
								}
							});
						} else if (index == 6) {
							uni.uploadFile({
								url: `${this.API}/driverService/upload`,
								fileType: 'image',
								name: 'file',
								filePath: res.tempFilePaths[0],
								file: res.tempFiles,
								header: {
									'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
									Authorization: uni.getStorageSync(this.DATA_KEY.token)
								},
								formData: {
									fileType: '6',
									phoneNumber: this.userInfo.phoneNumber,
									fileId: Math.floor(Math.random() * 1259),
									ocrOrNot: '1',
									orderId: ''
								},
								success: res => {
									uni.hideLoading();
									console.log('从业资格证: ', JSON.parse(res.data));
									if (JSON.parse(res.data).code == 0) {
										console.log(JSON.parse(res.data).data,
											"JSON.parse(res.data).data")

										this.license.tqcDeputy = JSON.parse(res.data).data;
									} else {
										uni.showToast({
											title: JSON.parse(res.data).msg,
											icon: 'none'
										});
									}
								},
								fail: error => {
									uni.showToast({
										title: '文件上传失败',
										icon: 'none'
									});
								}
							});
						} else if (index == 7) {
							uni.uploadFile({
								url: `${this.API}/driverService/upload_driving_license`,
								fileType: 'image',
								name: 'file',
								filePath: res.tempFilePaths[0],
								file: res.tempFiles,
								header: {
									'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
									Authorization: uni.getStorageSync(this.DATA_KEY.token)
								},
								formData: {
									fileType: '6',
									phoneNumber: this.userInfo.phoneNumber,
									fileId: Math.floor(Math.random() * 1259),
									ocrOrNot: '1',
									orderId: ''
								},
								success: res => {
									uni.hideLoading();
									console.log('挂车行驶证证正面: ', JSON.parse(res.data));
							
									if (JSON.parse(res.data).code == 0) {
										this.license.trailerInfo.pictureImg = JSON.parse(res.data).data.imgurl;   //挂车行驶证正页面
										this.license.trailerInfo.plateColour=JSON.parse(res.data).data.plateColour  //车牌颜色
										this.license.trailerInfo.natureUse = JSON.parse(res.data).data.natureUse;  //使用性质
										this.license.trailerInfo.plateNumOcr = JSON.parse(res.data).data.plateNum; //挂车车牌OCR
										this.license.trailerInfo.plateNum = JSON.parse(res.data).data.plateNum;   //挂车车牌
										this.license.trailerInfo.vehicleBrand = JSON.parse(res.data).data.vehicleBrand;   //车辆品牌
										this.license.trailerInfo.registerDate = this.fordata(JSON.parse(res.data).data.registerDate);  //注册日期
										this.license.trailerInfo.vin = JSON.parse(res.data).data.vin;  //车辆识别代码
										this.license.trailerInfo.issueDate = this.fordata(JSON.parse(res.data).data.issueDate);   //发证日期
										this.license.trailerInfo.owner = JSON.parse(res.data).data.owner;  //所有人
										this.license.trailerInfo.issuingOrganizations = JSON.parse(res.data).data.issuingOrganizations;  //发证机关
										this.license.trailerInfo.pictureImgFlag = JSON.parse(res.data).data.pictureImgFlag; //挂车正页图片是否正常 0正常、1异常
										this.license.trailerInfo.pictureImgMsg = JSON.parse(res.data).data.pictureImgMsg;  //挂车正页报错信息
										
										this.license.trailerInfo.isTractor = JSON.parse(res.data).data.isTractor
										console.log(this.license.trailerInfo.isTractor,"this.license.trailerInfo.isTractor")
										// 暂时屏蔽此功能
										// if(this.license.trailerInfo.isTractor != 2){
										// 	uni.showModal({
										// 		content:"系统检测到该证件非牵引车/挂车行驶证，请问是否重新上传",
										// 		success: (res) => {
										// 			if(res.confirm){
										// 				this.license.trailerInfo.pictureImg = this.modeimage01
										// 				this.license.trailerInfo.plateNumOcr="请选择"
										// 			}else if(res.cancel){
										// 				console.log("取消")
										// 			}
										// 		}
										// 	})
										// }
									
									} else {
										uni.showToast({
											title: JSON.parse(res.data).msg,
											icon: 'none'
										});
									}
								},
								fail: error => {
									uni.showToast({
										title: '文件上传失败',
										icon: 'none'
									});
								}
							});
						} else if (index == 8) {
							uni.uploadFile({
								url: `${this.API}/driverService/upload_driving_license_deputy`,
								fileType: 'image',
								name: 'file',
								filePath: res.tempFilePaths[0],
								file: res.tempFiles,
								header: {
									'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
									Authorization: uni.getStorageSync(this.DATA_KEY.token)
								},
								formData: {
									fileType: '6',
									phoneNumber: this.userInfo.phoneNumber,
									fileId: Math.floor(Math.random() * 1259),
									ocrOrNot: '1',
									orderId: ''
								},
								success: res => {
									uni.hideLoading();
									console.log('挂车行驶证副页: ', JSON.parse(res.data));
									if (JSON.parse(res.data).code == 0) {
										this.license.trailerInfo.pictureImgDeputy = JSON.parse(res.data).data.imgurl;  //挂车副页
										this.license.trailerInfo.plateNumDeputyOcr = JSON.parse(res.data).data.plateNumOcrDrivingPermit  //车牌号副页OCR识别
										this.license.trailerInfo.length = JSON.parse(res.data).data.length;  //车长
										this.license.trailerInfo.width = JSON.parse(res.data).data.width;    //车宽
										this.license.trailerInfo.high = JSON.parse(res.data).data.high;      //车高
										this.license.trailerInfo.validPeriod = this.fordata(JSON.parse(res.data).data.validPeriod); //挂车有效期
										this.license.trailerInfo.vehicleEnergyType = JSON.parse(res.data).data.vehicleEnergyType;   //车辆能源
										this.license.trailerInfo.fileNo = JSON.parse(res.data).data.fileNo;   //行驶证档案编号
										this.license.trailerInfo.pictureImgDeputyFlag = JSON.parse(res.data).data.pictureImgDeputyFlag;  //挂车副页图片 0正常、 1.异常
										this.license.trailerInfo.pictureImgDeputyMsg = JSON.parse(res.data).data.pictureImgDeputyMsg;  //挂车副页报错信息
									} else {
										uni.showToast({
											title: JSON.parse(res.data).msg,
											icon: 'none'
										});
									}
								},
								fail: error => {
									uni.showToast({
										title: '文件上传失败',
										icon: 'none'
									});
								}
							});
						}

					}
				});
			},
			onCancel() {
				this.$refs.popup.close()
			},
			onCamera(num) {
				let sourceType
				num === 0 ? sourceType = ['camera'] : sourceType = ['album']
				let index = this.selindex
				this.$refs.popup.close()
				uni.chooseImage({
					count: 1,
					sourceType: sourceType,
					sizeType: 'compressed',
					success: res => {
						uni.showLoading({
							title: '上传中'
						});
						if (index == 1) {
							uni.uploadFile({
								url: `${this.API}/driverService/upload_driving_license`,
								fileType: 'image',
								name: 'file',
								filePath: res.tempFilePaths[0],
								file: res.tempFiles,
								header: {
									'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
									Authorization: uni.getStorageSync(this.DATA_KEY.token)
								},
								formData: {
									fileType: '6',
									phoneNumber: this.userInfo.phoneNumber,
									fileId: Math.floor(Math.random() * 1259),
									ocrOrNot: '1',
									orderId: ''
								},
								success: res => {
									uni.hideLoading();
									console.log('行驶证正面: ', JSON.parse(res.data));
									if (JSON.parse(res.data).code == 0) {
										this.license.drivingLicense = JSON.parse(res.data).data.imgurl;
										this.license.natureUse = JSON.parse(res.data).data.natureUse;
										this.license._plateNum = JSON.parse(res.data).data.plateNum;
										this.license.plateNum = JSON.parse(res.data).data.plateNum;
										this.license.vehicleBrand = JSON.parse(res.data).data.vehicleBrand;
										this.license.registerDate = this.fordata(JSON.parse(res.data).data.registerDate);
										this.license.vin = JSON.parse(res.data).data.vin;
										this.license.issueDate = this.fordata(JSON.parse(res.data).data.issueDate);
										this.license.owner = JSON.parse(res.data).data.owner;
										this.license.issuingOrganizations = JSON.parse(res.data).data.issuingOrganizations;
										this.license.area = JSON.parse(res.data).data.area;
										this.license.type = JSON.parse(res.data).data.type;
										this.license.uploadDrivingLicenseFlag = JSON.parse(res.data).data.uploadDrivingLicenseFlag;
										this.license.uploadDrivingLicenseMsg = JSON.parse(res.data).data.uploadDrivingLicenseMsg;
                                        //isTractor为车辆类型 0.非牵引车、1.牵引车、2.挂车
										this.license.isTractor = JSON.parse(res.data).data.isTractor;
										//暂时屏蔽此区域
										// if(this.license.isTractor == 2){
										// 	uni.showModal({
										// 		content:"系统检测到该证件为挂车行驶证，请问是否切换到挂车证件上传",
										// 		success: (res) => {
										// 			if(res.confirm){
										// 				this.license.isTractor = 1;
										// 				this.license.trailerInfo.pictureImg =this.license.drivingLicense  //挂车行驶证正页
										// 				this.license.trailerInfo.natureUse = this.license.natureUse   //使用性质
										// 				this.license.trailerInfo.plateNumOcr = this.license._plateNum  //车牌ORC
										// 				this.license.trailerInfo.plateNum = this.license.plateNum  //车牌号														this.license.trailerInfo.vehicleBrand =this.license.vehicleBrand  //车辆品牌
										// 				this.license.trailerInfo.registerDate = this.license.registerDate  //注册日期
										// 				this.license.trailerInfo.vin =this.license.vin  //车辆识别代码
										// 				this.license.trailerInfo.issueDate = this.license.issueDate  //发证日期
										// 				this.license.trailerInfo.owner = this.license.owner//所有人
										// 				this.license.trailerInfo.issuingOrganizations = this.license.issuingOrganizations//发证机关
										// 				this.license.trailerInfo.pictureImgFlag = this.license.uploadDrivingLicenseFlag  //挂车正页是否正常  0正常 1异常
										// 				this.license.trailerInfo.pictureImgMsg = this.license.uploadDrivingLicenseMsg;  //挂车正页报错信息
										// 				//重置行驶证信息
										// 				this.license.drivingLicense = this.modeimage01;
										// 				this.license._plateNum='请选择';
										// 			}else if(res.cancel){
										// 				this.license.isTractor = 0;
										// 			}
										// 		}
										// 	})
										// }
										
										//isTractorOcr为车辆类型OCR  0.非牵引车、1牵引车、2.挂车
										this.license.isTractorOcr = JSON.parse(res.data).data.isTractorOcr
										 
										
									} else {
										uni.showToast({
											title: JSON.parse(res.data).msg,
											icon: 'none'
										});
									}
								},
								fail: error => {
									uni.showToast({
										title: '文件上传失败',
										icon: 'none'
									});
								}
							});
						} else if (index == 2) {
							uni.uploadFile({
								url: `${this.API}/driverService/upload_driving_license_deputy`,
								fileType: 'image',
								name: 'file',
								filePath: res.tempFilePaths[0],
								file: res.tempFiles,
								header: {
									'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
									Authorization: uni.getStorageSync(this.DATA_KEY.token)
								},
								formData: {
									fileType: '6',
									phoneNumber: this.userInfo.phoneNumber,
									fileId: Math.floor(Math.random() * 1259),
									ocrOrNot: '1',
									orderId: ''
								},
								success: res => {
									uni.hideLoading();
									console.log('行驶证副页: ', JSON.parse(res.data));
									if (JSON.parse(res.data).code == 0) {
										this.license.vehicleLicenseDeputy = JSON.parse(res.data).data.imgurl;
										this.license.plateNumOcrDrivingPermit = JSON.parse(res.data).data.plateNumOcrDrivingPermit;
										this.license.tonnage = JSON.parse(res.data).data.tonnage;
										this.license.approvedLoad = JSON.parse(res.data).data.approvedLoad;
										this.license.length = JSON.parse(res.data).data.length;
										this.license.width = JSON.parse(res.data).data.width;
										this.license.high = JSON.parse(res.data).data.high;
										this.license.validPeriod = this.fordata(JSON.parse(res.data).data.validPeriod);
										this.license.vehicleEnergyType = JSON.parse(res.data).data.vehicleEnergyType;
										this.license.curbWeight = JSON.parse(res.data).data.curbWeight;
										this.license.quasiTraction = JSON.parse(res.data).data.quasiTraction;
										this.license.fileNo = JSON.parse(res.data).data.fileNo;
										this.license.weightFlag = JSON.parse(res.data).data.weightFlag;
										this.license.tqcFlag = JSON.parse(res.data).data.tqcFlag;
										this.license.uploadDrivingLicenseDeputyFlag = JSON.parse(res.data).data.uploadDrivingLicenseDeputyFlag;
										this.license.uploadDrivingLicenseDeputyMsg = JSON.parse(res.data).data.uploadDrivingLicenseDeputyMsg;
									} else {
										uni.showToast({
											title: JSON.parse(res.data).msg,
											icon: 'none'
										});
									}
								},
								fail: error => {
									uni.showToast({
										title: '文件上传失败',
										icon: 'none'
									});
								}
							});
						} else if (index == 3) {
							uni.uploadFile({
								url: `${this.API}/driverService/uploadRoadTransportCertificate`,
								fileType: 'image',
								name: 'file',
								filePath: res.tempFilePaths[0],
								file: res.tempFiles,
								header: {
									'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
									Authorization: uni.getStorageSync(this.DATA_KEY.token)
								},
								formData: {
									fileType: '6',
									phoneNumber: this.userInfo.phoneNumber,
									fileId: Math.floor(Math.random() * 1259),
									ocrOrNot: '1',
									orderId: ''
								},
								success: res => {
									uni.hideLoading();
									console.log('道路运输证: ', JSON.parse(res.data));
									if (JSON.parse(res.data).code == 0) {
										this.license.rtc = JSON.parse(res.data).data.imgurl;
										this.license._rtcNo = JSON.parse(res.data).data.rtcNo;
										this.license.rtcNo = JSON.parse(res.data).data.rtcNo;
										this.license.uploadRtcFlag = JSON.parse(res.data).data.uploadRtcFlag;
										this.license.uploadRtcMsg = JSON.parse(res.data).data.uploadRtcMsg;
									} else {
										uni.showToast({
											title: JSON.parse(res.data).msg,
											icon: 'none'
										});
									}
								},
								fail: error => {
									uni.showToast({
										title: '文件上传失败',
										icon: 'none'
									});
								}
							});
						} else if (index == 4) {
							uni.uploadFile({
								url: `${this.API}/driverService/upload`,
								fileType: 'image',
								name: 'file',
								filePath: res.tempFilePaths[0],
								file: res.tempFiles,
								header: {
									'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
									Authorization: uni.getStorageSync(this.DATA_KEY.token)
								},
								formData: {
									fileType: '6',
									phoneNumber: this.userInfo.phoneNumber,
									fileId: Math.floor(Math.random() * 1259),
									ocrOrNot: '1',
									orderId: ''
								},
								success: res => {
									uni.hideLoading();
									console.log('道路运输证: ', JSON.parse(res.data));
									if (JSON.parse(res.data).code == 0) {
										this.license.rtcDeputy = JSON.parse(res.data).data;
									} else {
										uni.showToast({
											title: JSON.parse(res.data).msg,
											icon: 'none'
										});
									}
								},
								fail: error => {
									uni.showToast({
										title: '文件上传失败',
										icon: 'none'
									});
								}
							});
						} else if (index == 5) {
							uni.uploadFile({
								url: `${this.API}/driverService/uploadTqc`,
								fileType: 'image',
								name: 'file',
								filePath: res.tempFilePaths[0],
								file: res.tempFiles,
								header: {
									'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
									Authorization: uni.getStorageSync(this.DATA_KEY.token)
								},
								formData: {
									fileType: '6',
									phoneNumber: this.userInfo.phoneNumber,
									fileId: Math.floor(Math.random() * 1259),
									ocrOrNot: '1',
									orderId: ''
								},
								success: res => {
									uni.hideLoading();
									console.log('从业资格证: ', JSON.parse(res.data));
									if (JSON.parse(res.data).code == 0) {
										this.license.tqc = JSON.parse(res.data).data.imgurl;
										this.license.tqcNo = JSON.parse(res.data).data.tqcNo;
									} else {
										uni.showToast({
											title: JSON.parse(res.data).msg,
											icon: 'none'
										});
									}
								},
								fail: error => {
									uni.showToast({
										title: '文件上传失败',
										icon: 'none'
									});
								}
							});
						} else if (index == 6) {
							uni.uploadFile({
								url: `${this.API}/driverService/upload`,
								fileType: 'image',
								name: 'file',
								filePath: res.tempFilePaths[0],
								file: res.tempFiles,
								header: {
									'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
									Authorization: uni.getStorageSync(this.DATA_KEY.token)
								},
								formData: {
									fileType: '6',
									phoneNumber: this.userInfo.phoneNumber,
									fileId: Math.floor(Math.random() * 1259),
									ocrOrNot: '1',
									orderId: ''
								},
								success: res => {
									uni.hideLoading();
									console.log('从业资格证: ', JSON.parse(res.data));
									if (JSON.parse(res.data).code == 0) {
										this.license.tqcDeputy = JSON.parse(res.data).data;
									} else {
										uni.showToast({
											title: JSON.parse(res.data).msg,
											icon: 'none'
										});
									}
								},
								fail: error => {
									uni.showToast({
										title: '文件上传失败',
										icon: 'none'
									});
								}
							});
						} else if (index == 7) {
							uni.uploadFile({
								url: `${this.API}/driverService/upload_driving_license`,
								fileType: 'image',
								name: 'file',
								filePath: res.tempFilePaths[0],
								file: res.tempFiles,
								header: {
									'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
									Authorization: uni.getStorageSync(this.DATA_KEY.token)
								},
								formData: {
									fileType: '6',
									phoneNumber: this.userInfo.phoneNumber,
									fileId: Math.floor(Math.random() * 1259),
									ocrOrNot: '1',
									orderId: ''
								},
								success: res => {
									uni.hideLoading();
									console.log('挂车行驶证正面: ', JSON.parse(res.data));
									if (JSON.parse(res.data).code == 0) {
										this.license.trailerInfo.pictureImg = JSON.parse(res.data).data.imgurl;   //挂车行驶证正页面
										this.license.trailerInfo.natureUse = JSON.parse(res.data).data.natureUse;  //使用性质
										this.license.trailerInfo.plateNumOcr = JSON.parse(res.data).data.plateNum; //挂车车牌OCR
										this.license.trailerInfo.plateNum = JSON.parse(res.data).data.plateNum;   //挂车车牌
										this.license.trailerInfo.vehicleBrand = JSON.parse(res.data).data.vehicleBrand;   //车辆品牌
										this.license.trailerInfo.registerDate = this.fordata(JSON.parse(res.data).data.registerDate);  //注册日期
										this.license.trailerInfo.vin = JSON.parse(res.data).data.vin;  //车辆识别代码
										this.license.trailerInfo.issueDate = this.fordata(JSON.parse(res.data).data.issueDate);   //发证日期
										this.license.trailerInfo.owner = JSON.parse(res.data).data.owner;  //所有人
										this.license.trailerInfo.issuingOrganizations = JSON.parse(res.data).data.issuingOrganizations;  //发证机关
										this.license.trailerInfo.pictureImgFlag = JSON.parse(res.data).data.uploadDrivingLicenseFlag; //挂车正页图片是否正常 0正常、1异常
										this.license.trailerInfo.pictureImgMsg = JSON.parse(res.data).data.uploadDrivingLicenseMsg;  //挂车正页报错信息
							            this.license.trailerInfo.isTractor = JSON.parse(res.data).data.isTractor;
							//暂时屏蔽此区域
							// if(this.license.trailerInfo.isTractor != 2){
							// 	uni.showModal({
							// 		content:"系统检测到该证件非牵引车行驶证，请问是否重新上传",
							// 		success: (res) => {
							// 			if(res.confirm){
							// 				this.license.trailerInfo.pictureImg = this.modeimage01
							// 				this.license.trailerInfo.plateNumOcr="请选择"
							// 			}else if(res.cancel){
							// 				console.log("取消")
							// 			}
							// 		}
							// 	})
							// }
										
									} else {
										uni.showToast({
											title: JSON.parse(res.data).msg,
											icon: 'none'
										});
									}
								},
								fail: error => {
									uni.showToast({
										title: '文件上传失败',
										icon: 'none'
									});
								}
							});
						} else if (index == 8) {
					      uni.uploadFile({
					      	url: `${this.API}/driverService/upload_driving_license_deputy`,
					      	fileType: 'image',
					      	name: 'file',
					      	filePath: res.tempFilePaths[0],
					      	file: res.tempFiles,
					      	header: {
					      		'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
					      		Authorization: uni.getStorageSync(this.DATA_KEY.token)
					      	},
					      	formData: {
					      		fileType: '6',
					      		phoneNumber: this.userInfo.phoneNumber,
					      		fileId: Math.floor(Math.random() * 1259),
					      		ocrOrNot: '1',
					      		orderId: ''
					      	},
					      	success: res => {
					      		uni.hideLoading();
					      		console.log('挂车行驶证副页: ', JSON.parse(res.data));
					      		if (JSON.parse(res.data).code == 0) {
					      			this.license.trailerInfo.pictureImgDeputy = JSON.parse(res.data).data.imgurl;  //挂车副页
									this.license.trailerInfo.plateNumDeputyOcr = JSON.parse(res.data).data.plateNumOcrDrivingPermit  //车牌号副页OCR识别
					      			this.license.trailerInfo.length = JSON.parse(res.data).data.length;  //车长
					      			this.license.trailerInfo.width = JSON.parse(res.data).data.width;    //车宽
					      			this.license.trailerInfo.high = JSON.parse(res.data).data.high;      //车高
					      			this.license.trailerInfo.validPeriod = this.fordata(JSON.parse(res.data).data.validPeriod); //挂车有效期
					      			this.license.trailerInfo.vehicleEnergyType = JSON.parse(res.data).data.vehicleEnergyType;   //车辆能源
					      			this.license.trailerInfo.fileNo = JSON.parse(res.data).data.fileNo;   //行驶证档案编号
					      			this.license.trailerInfo.pictureImgDeputyFlag = JSON.parse(res.data).data.uploadDrivingLicenseDeputyFlag;  //挂车副页图片 0正常、 1.异常
					      			this.license.trailerInfo.pictureImgDeputyMsg = JSON.parse(res.data).data.uploadDrivingLicenseDeputyMsg;  //挂车副页报错信息
					      		} else {
					      			uni.showToast({
					      				title: JSON.parse(res.data).msg,
					      				icon: 'none'
					      			});
					      		}
					      	},
					      	fail: error => {
					      		uni.showToast({
					      			title: '文件上传失败',
					      			icon: 'none'
					      		});
					      	}
					      });
						} else if (index == 9) {
							uni.uploadFile({
								url: `${this.API}/driverService/upload`,
								fileType: 'image',
								name: 'file',
								filePath: res.tempFilePaths[0],
								file: res.tempFiles,
								header: {
									'Content-Type': 'multipart/form-data;boundary=ebf9f03029db4c2799ae16b5428b06bds',
									Authorization: uni.getStorageSync(this.DATA_KEY.token)
								},
								formData: {
									fileType: '6',
									phoneNumber: this.userInfo.phoneNumber,
									fileId: Math.floor(Math.random() * 1259),
									ocrOrNot: '1',
									orderId: ''
								},
								success: res => {
									uni.hideLoading();
									console.log('保险文件: ', JSON.parse(res.data));
									if (JSON.parse(res.data).code == 0) {
										this.license.insuranceUrl = JSON.parse(res.data).data;
									} else {
										uni.showToast({
											title: JSON.parse(res.data).msg,
											icon: 'none'
										});
									}
								},
								fail: error => {
									uni.showToast({
										title: '文件上传失败',
										icon: 'none'
									});
								}
							});
						}
					},
					fail: (err) => {
						console.log(err)
					}
				})
			},
			fordata(validPeriod) {
				let reg = new RegExp("\\d{4}(-|/|.)\\d{2}(-|/|.)\\d{2}");
				let ret = reg.test(validPeriod);
				console.log(ret);
				if (!ret) {
					return "";
				} else {
					return validPeriod.match(reg)[0]
				}
			},
			_submit(num) {
				var that = this;
				this.license.uploadRtcFlag = this.license.uploadRtcFlag || 0
				// let data = {
				// 	vehicleInfoUnified: this.license,
				// 	"dataSources": 1,
				// 	"etpId": "1413763041450962946",
				// 	"driverId": "1434262985144009593",
				// 	"tqc": "",
				// 	"tqcDeputy": "",
				// 	"tqcNo": "",
				// 	"clickLocation": "1"
				// }
				// console.log(data,'chuanrushuju-----------------------')
				this.wxRequest({
					url: `${this.API}/driverService/driverRelVehicle`,
					// url: `${this.API}/DriverVehicleUnified/vehicleAdd`,//统一接口
					method: 'POST',
					data: this.license,
					title: '提交中...',
					success: res => {
						uni.redirectTo({
							url: '/pages/personal/review?iscar=' + true + '&&num=' + num + '&&text=车辆'
						});
					},
					fail: error => {
						this.license.tractorType = this.license.dicValue;
						this.license.vanType = this.license.vanType;
						this.license.vehicleType = this.multiArray[0][this.multiIndex[0]].dicName + ' ' + this.multiArray[1][this.multiIndex[1]].dicName;
						this.license.validPeriod = this.license.validPeriod;
						this.license.plateColour = this.array1[parseInt(this.license.plateColour) - 1].dicName;
						this.license.vehicleColour = this.array2[parseInt(this.license.vehicleColour) - 1].dicName;
						this.license.axle = this.array[parseInt(this.license.axle) - 1].dicName;
						this.license.vehicleNature = this.array3[parseInt(this.license.vehicleNature) - 1].dicName;
					},
					complete: data => {
						this.license.tractorType = this.license.dicValue;
						this.license.vanType = this.license.vanType;
						this.license.vehicleType = this.multiArray[0][this.multiIndex[0]].dicName + ' ' + this.multiArray[1][this.multiIndex[1]].dicName;
						this.license.validPeriod = this.license.validPeriod;
						this.license.plateColour = this.array1[parseInt(this.license.plateColour) - 1].dicName;
						this.license.vehicleColour = this.array2[parseInt(this.license.vehicleColour) - 1].dicName;  
						this.license.axle = this.array[parseInt(this.license.axle) - 1].dicName;
						this.license.vehicleNature = this.array3[parseInt(this.license.vehicleNature) - 1].dicName;
					}
				});
			},
			_editType() {
				this.license.plateColour = this.array1[this.index1].dicValue;  //车牌颜色
				this.license.vehicleColour = this.array2[this.index2].dicValue;  //车辆颜色
				this.license.axle = this.array[this.index].dicValue;    //车轴
				this.license.vehicleNature = this.array3[this.index3].dicValue;  //车辆性质
				this.license.driverId = this.userInfo.driverId;
				this.license.etpId = uni.getStorageSync(this.DATA_KEY.etpId);
				this.license.vehicleId = this.vehicleId;
			},
			onnext() {
				let that = this
				this.etpName = uni.getStorageSync(this.DATA_KEY.etpName);
				// console.log(this.etpName,this.license.owner)
				// if(this.etpName == this.license.owner){
				// 	this.sameShow = true
				// 	// uni.showModal({
				// 	// 	title: '车辆所有人企业与当前委托方企业一致，无法在当前企业新增！',
				// 	// 	icon: 'none',
				// 	// 	showCancel: false
				// 	// });
				// 	setTimeout(function(){
				// 		that.sameShow = false
				// 	},2000)
					
				// 	return false
				// }
				console.log(!this.license._plateNum || this.license._plateNum.length != 7 && this.license._plateNum
					.length != 8)
				if (!this.license._plateNum || this.license._plateNum.length != 7 && this.license._plateNum.length != 8) {
					uni.showToast({
						title: '请输入有效的车牌号！',
						icon: 'none'
					});
					return
				}
				console.log(this.license.drivingLicense,"行驶证正页")
				console.log(this.license.vehicleLicenseDeputy,"行驶证副页")
				console.log(this.license.plateColour,"车牌颜色")
				console.log(this.license.vehicleNature,"车辆性质")
				if (this.license.drivingLicense != '' && this.license.vehicleLicenseDeputy != '' && this.license
					.plateColour != '请选择' && this.license.vehicleNature != '请选择' && this.license.insuranceUrl != '') {
					// if (this.license.drivingLicense != '' && this.license.vehicleLicenseDeputy != '' && this.license.plateColour != '请选择') {
					if (this.license.weightFlag == true) {
						console.log(!this.license.rtc)
						console.log(!this.license.rtcDeputy)
						if (!this.license.rtc) {
							uni.showToast({
								title: '上传道路运输证！',
								icon: 'none'
							});
							return
						}
						if (this.license.rtc != '' && this.index1 !== '' && this.index3 !== '') {
							if (!this.license._rtcNo) {
								uni.showToast({
									title: '请输入道路运输证号！',
									icon: 'none'
								});
								return
							}
							const regex = /^\d{8,12}$/;
							if (!regex.test(this.license._rtcNo)) {
								uni.showToast({
									title: '道路运输证号为8位到12位数字，请检查是否输入正确!',
									icon: 'none'
								});
								return
							}
							// if (this.license._rtcNo.length < 5 || this.license._rtcNo.length > 15) {
							// 	uni.showToast({
							// 		title: '请输入有效的道路运输证号！',
							// 		icon: 'none'
							// 	});
							// 	return
							// }
							if (  this.license.tqcFlag == true &&  !this.license.tqc) {
								// delete this.license.tqc
								uni.showToast({
									title:"请上传从业资格证",
									icon:'none'
								})
								return
							}
							if (!this.license.insuranceUrl) {
								uni.showToast({
									title: "请上传交强险保险单",
									icon: "none"
								})
								return
							}
							// if (!this.license.tqcDeputy) {
							// 	delete this.license.tqcDeputy
							// }
						
							// if( this.license.isTractor == 1  ){
							// 	if(!this.license.trailerInfo.pictureImg && !this.license.trailerInfo.pictureImgDeputy&& !this.license.trailerInfo.plateNumOcr)
							// 	uni.showToast({
							// 		title: '挂车行驶证或车牌不能为空！',
							// 		icon: 'none'
							// 	});
							// 	return
							// }
							
							this._editType()
							if (this.license._plateNum != this.license.plateNum || this.license._plateNum != this.license.plateNumOcrDrivingPermit) {
								uni.showModal({
									content: '您提交的车牌号和证件不一致，请重新修改后再提交',
									cancelText: '去申诉',
									cancelColor: '#999999',
									success: res => {
										if (res.confirm) {
											this.license.tractorType = this.license.dicValue;
											this.license.vanType = this.license.vanType;
											this.license.vehicleType = this.multiArray[0][this.multiIndex[0]].dicName + ' ' + this.multiArray[1][this.multiIndex[1]].dicName;
											this.license.validPeriod = this.license.validPeriod;
											this.license.plateColour = this.array1[parseInt(this.license.plateColour) - 1].dicName;
											this.license.vehicleColour = this.array2[parseInt(this.license.vehicleColour) - 1].dicName;
											this.license.axle = this.array[parseInt(this.license.axle) - 1].dicName;
											this.license.vehicleNature = this.array3[parseInt(this.license.vehicleNature) - 1].dicName;
											return
										} else if (res.cancel) {
											this.license.uploadDrivingLicenseFlag = 1
											this.license.uploadDrivingLicenseMsg = '提交的车牌号和证件不一致，请重新修改后再提交'
											that._submit(1)
										}
									}
								})
							} else if (!this.license.validPeriod) {
								uni.showModal({
									content: '您提交的行驶证证疑似非有效证件，请重新修改后再提交',
									cancelText: '去申诉',
									cancelColor: '#999999',
									success: res => {
										if (res.confirm) {
											this.license.tractorType = this.license.dicValue;
											this.license.vanType = this.license.vanType;
											this.license.vehicleType = this.multiArray[0][this.multiIndex[0]].dicName + ' ' + this.multiArray[1][this.multiIndex[1]].dicName;
											this.license.validPeriod = this.license.validPeriod;
											this.license.plateColour = this.array1[parseInt(this.license.plateColour) - 1].dicName;
											this.license.vehicleColour = this.array2[parseInt(this.license.vehicleColour) - 1].dicName;
											this.license.axle = this.array[parseInt(this.license.axle) - 1].dicName;
											// 新增挂车信息的时候屏蔽此处 没有
											this.license.vehicleNature = this.array3[parseInt(this.license.vehicleNature) - 1].dicName;
											return
										} else if (res.cancel) {
											this.license.uploadDrivingLicenseDeputyFlag = 1
											this.license.uploadDrivingLicenseDeputyMsg ='行驶证强制报废期不存在，请重新修改后再提交'
											that._submit(1)
										}
									}
								})
							} else if (Date.parse(this.license.validPeriod) + 24 * 60 * 60 * 1000 < new Date().getTime()) {
								uni.showModal({
									content: '您提交的行驶证已过期，请重新修改后再提交',
									cancelText: '去申诉',
									cancelColor: '#999999',
									success: res => {
										if (res.confirm) {
											this.license.tractorType = this.license.dicValue;
											this.license.vanType = this.license.vanType;
											this.license.vehicleType = this.multiArray[0][this.multiIndex[0]].dicName + ' ' + this.multiArray[1][this.multiIndex[1]].dicName;
											this.license.validPeriod = this.license.validPeriod;
											this.license.plateColour = this.array1[parseInt(this.license.plateColour) - 1].dicName;
											this.license.vehicleColour = this.array2[parseInt(this.license.vehicleColour) - 1].dicName;
											this.license.axle = this.array[parseInt(this.license.axle) - 1].dicName;
											this.license.vehicleNature = this.array3[parseInt(this.license.vehicleNature) - 1].dicName;
											return
										} else if (res.cancel) {
											this.license.uploadDrivingLicenseDeputyFlag = 1
											this.license.uploadDrivingLicenseDeputyMsg =
												'行驶证强制报废期小于当前时间，请重新修改后再提交'
											that._submit(1)
										}
									}
								})
							} else if (this.license.uploadDrivingLicenseFlag == 1 || this.license
								.uploadDrivingLicenseDeputyFlag == 1) {
								uni.showModal({
									content: '您提交的行驶证证疑似非有效证件，请重新修改后再提交',
									cancelText: '去申诉',
									cancelColor: '#999999',
									success: res => {
										if (res.confirm) {
											this.license.tractorType = this.license.dicValue;
											this.license.vanType = this.license.vanType;
											this.license.vehicleType = this.multiArray[0][this.multiIndex[0]].dicName + ' ' + this.multiArray[1][this.multiIndex[1]].dicName;
											this.license.validPeriod = this.license.validPeriod;
											this.license.plateColour = this.array1[parseInt(this.license.plateColour) - 1].dicName;
											this.license.vehicleColour = this.array2[parseInt(this.license.vehicleColour) - 1].dicName;
											this.license.axle = this.array[parseInt(this.license.axle) - 1].dicName;
											this.license.vehicleNature = this.array3[parseInt(this.license.vehicleNature) - 1].dicName;
											return
										} else if (res.cancel) {
											that._submit(1)
										}
									}
								})
							} else if (this.license.natureUse != '货运') {
								uni.showModal({
									content: '您提交的车辆使用性质非货运，请确认后再提交',
									cancelText: '去申诉',
									cancelColor: '#999999',
									success: res => {
										if (res.confirm) {
											this.license.tractorType = this.license.dicValue;
											this.license.vanType = this.license.vanType;
											this.license.vehicleType = this.multiArray[0][this.multiIndex[0]].dicName + ' ' + this.multiArray[1][this.multiIndex[1]].dicName;
											this.license.validPeriod = this.license.validPeriod;
											this.license.plateColour = this.array1[parseInt(this.license.plateColour) - 1].dicName;
											this.license.vehicleColour = this.array2[parseInt(this.license.vehicleColour) - 1].dicName;
											this.license.axle = this.array[parseInt(this.license.axle) - 1].dicName;
											this.license.vehicleNature = this.array3[parseInt(this.license.vehicleNature) - 1].dicName;
											return
										} else if (res.cancel) {
											that._submit(1)
										}
									}
								})
							} else {
								this._submit(2)
							}
						} else {
							if (!this.license._rtcNo) {
								uni.showToast({
									title: '请填写道路运输证！',
									icon: 'none'
								});
							} else {
								uni.showToast({
									title: '请完善信息！',
									icon: 'none'
								});
							}
						}
					}else {
						this._editType()
						if (this.license._plateNum != this.license.plateNum || this.license._plateNum != this.license.plateNumOcrDrivingPermit) {
							uni.showModal({
								content: '您提交的车牌号和证件不一致，请重新修改后再提交',
								cancelText: '去申诉',
								cancelColor: '#999999',
								success: res => {
									if (res.confirm) {
										this.license.tractorType = this.license.dicValue;
										this.license.vanType = this.license.vanType;
										this.license.vehicleType = this.multiArray[0][this.multiIndex[0]].dicName + ' ' + this.multiArray[1][this.multiIndex[1]].dicName;
										this.license.validPeriod = this.license.validPeriod;
										this.license.plateColour = this.array1[parseInt(this.license.plateColour) - 1].dicName;
										this.license.vehicleColour = this.array2[parseInt(this.license.vehicleColour) - 1].dicName;
										this.license.axle = this.array[parseInt(this.license.axle) - 1].dicName;
										this.license.vehicleNature = this.array3[parseInt(this.license.vehicleNature) - 1].dicName;
										return
									} else if (res.cancel) {
										this.license.uploadDrivingLicenseFlag = 1
										this.license.uploadDrivingLicenseMsg = '提交的车牌号和证件不一致，请重新修改后再提交'
										that._submit(1)
									}
								}
							})
						} else if (!this.license.validPeriod) {
							uni.showModal({
								content: '您提交的行驶证证疑似非有效证件，请重新修改后再提交',
								cancelText: '去申诉',
								cancelColor: '#999999',
								success: res => {
									if (res.confirm) {
										this.license.tractorType = this.license.dicValue;
										this.license.vanType = this.license.vanType;
										this.license.vehicleType = this.multiArray[0][this.multiIndex[0]].dicName + ' ' + this.multiArray[1][this.multiIndex[1]].dicName;
										this.license.validPeriod = this.license.validPeriod;
										this.license.plateColour = this.array1[parseInt(this.license.plateColour) - 1].dicName;
										this.license.vehicleColour = this.array2[parseInt(this.license.vehicleColour) - 1].dicName;
										this.license.axle = this.array[parseInt(this.license.axle) - 1].dicName;
										this.license.vehicleNature = this.array3[parseInt(this.license.vehicleNature) - 1].dicName;
										return
									} else if (res.cancel) {
										this.license.uploadDrivingLicenseDeputyFlag = 1
										this.license.uploadDrivingLicenseDeputyMsg = '行驶证强制报废期不存在，请重新修改后再提交'
										that._submit(1)
									}
								}
							})
						} else if (Date.parse(this.license.validPeriod) + 24 * 60 * 60 * 1000 < new Date().getTime()) {
							uni.showModal({
								content: '您提交的行驶证已过期，请重新修改后再提交',
								cancelText: '去申诉',
								cancelColor: '#999999',
								success: res => {
									if (res.confirm) {
										this.license.tractorType = this.license.dicValue;
										this.license.vanType = this.license.vanType;
										this.license.vehicleType = this.multiArray[0][this.multiIndex[0]].dicName + ' ' + this.multiArray[1][this.multiIndex[1]].dicName;
										this.license.validPeriod = this.license.validPeriod;
										this.license.plateColour = this.array1[parseInt(this.license.plateColour) - 1].dicName;
										this.license.vehicleColour = this.array2[parseInt(this.license.vehicleColour) - 1].dicName;
										this.license.axle = this.array[parseInt(this.license.axle) - 1].dicName;
										this.license.vehicleNature = this.array3[parseInt(this.license.vehicleNature) - 1].dicName;
										return
									} else if (res.cancel) {
										this.license.uploadDrivingLicenseDeputyFlag = 1
										this.license.uploadDrivingLicenseDeputyMsg = '行驶证强制报废期小于当前时间，请重新修改后再提交'
										that._submit(1)
									}
								}
							})
						} else if (this.license.uploadDrivingLicenseFlag == 1 || this.license
							.uploadDrivingLicenseDeputyFlag == 1) {
							uni.showModal({
								content: '您提交的行驶证证疑似非有效证件，请重新修改后再提交',
								cancelText: '去申诉',
								cancelColor: '#999999',
								success: res => {
									if (res.confirm) {
										this.license.tractorType = this.license.dicValue;
										this.license.vanType = this.license.vanType;
										this.license.vehicleType = this.multiArray[0][this.multiIndex[0]].dicName + ' ' + this.multiArray[1][this.multiIndex[1]].dicName;
										this.license.validPeriod = this.license.validPeriod;
										this.license.plateColour = this.array1[parseInt(this.license.plateColour) - 1].dicName;
										this.license.vehicleColour = this.array2[parseInt(this.license.vehicleColour) - 1].dicName;
										this.license.axle = this.array[parseInt(this.license.axle) - 1].dicName;
										this.license.vehicleNature = this.array3[parseInt(this.license.vehicleNature) - 1].dicName;
										return
									} else if (res.cancel) {
										that._submit(1)
									}
								}
							})
						} else if (this.license.natureUse != '货运') {
							uni.showModal({
								content: '您提交的车辆使用性质非货运，请确认后再提交',
								cancelText: '去申诉',
								cancelColor: '#999999',
								success: res => {
									if (res.confirm) {
										this.license.tractorType = this.license.dicValue;
										this.license.vanType = this.license.vanType;
										this.license.vehicleType = this.multiArray[0][this.multiIndex[0]].dicName + ' ' + this.multiArray[1][this.multiIndex[1]].dicName;
										this.license.validPeriod = this.license.validPeriod;
										this.license.plateColour = this.array1[parseInt(this.license.plateColour) - 1].dicName;
										this.license.vehicleColour = this.array2[parseInt(this.license.vehicleColour) - 1].dicName;
										this.license.axle = this.array[parseInt(this.license.axle) - 1].dicName;
										this.license.vehicleNature = this.array3[parseInt(this.license.vehicleNature) - 1].dicName;
										return
									} else if (res.cancel) {
										that._submit(1)
									}
								}
							})
						} else {
							this._submit(2)
						}

						// this.wxRequest({
						// 	url: `${this.API}/driverService/driverVehicleSubmit`,
						// 	method: 'POST',
						// 	data: this.license,
						// 	title: '提交中...',
						// 	success: res => {
						// 		uni.redirectTo({
						// 			url: '../personal/review?iscar='+true
						// 		});
						// 	},
						// 	fail: error => {
						// 		this.license.tractorType = this.license.dicValue;
						// 		this.license.vanType = this.license.vanType;
						// 		this.license.vehicleType = this.multiArray[0][this.multiIndex[0]].dicName + ' ' + this.multiArray[1][this.multiIndex[1]].dicName;
						// 		this.license.validPeriod = this.license.validPeriod;
						// 		console.log('===========', parseInt(this.license.plateColour) - 1);
						// 		console.log('===========', this.array1[parseInt(this.license.plateColour) - 1].dicName);
						// 		this.license.plateColour = this.array1[parseInt(this.license.plateColour) - 1].dicName;
						// 		this.license.vehicleColour = this.array2[parseInt(this.license.vehicleColour) - 1].dicName;
						// 		this.license.axle = this.array[parseInt(this.license.axle) - 1].dicName;
						// 		this.license.vehicleNature = this.array3[parseInt(this.license.vehicleNature) - 1].dicName;
						// 	}
						// });
						// } else {
						/* this.wxRequest({
							url: `${this.API}/driverService/driverRelVehicle`,
							method: 'POST',
							data: this.license,
							title: '提交中...',
							success: res => {
								uni.redirectTo({
									url: '../personal/review?iscar=' + true
								});
							},
							fail: error => {
								this.license.tractorType = this.license.dicValue;
								this.license.vanType = this.license.vanType;
								this.license.vehicleType = this.multiArray[0][this.multiIndex[0]].dicName + ' ' + this.multiArray[1][this.multiIndex[1]].dicName;
								this.license.validPeriod = this.license.validPeriod;
								console.log('===========', parseInt(this.license.plateColour) - 1);
								console.log('===========', this.array1[parseInt(this.license.plateColour) - 1].dicName);
								this.license.plateColour = this.array1[parseInt(this.license.plateColour) - 1].dicName;
								this.license.vehicleColour = this.array2[parseInt(this.license.vehicleColour) - 1].dicName;
								this.license.axle = this.array[parseInt(this.license.axle) - 1].dicName;
								this.license.vehicleNature = this.array3[parseInt(this.license.vehicleNature) - 1].dicName;
							},
							complete: data =>{
								this.license.tractorType = this.license.dicValue;
								this.license.vanType = this.license.vanType;
								this.license.vehicleType = this.multiArray[0][this.multiIndex[0]].dicName + ' ' + this.multiArray[1][this.multiIndex[1]].dicName;
								this.license.validPeriod = this.license.validPeriod;
								this.license.plateColour = this.array1[parseInt(this.license.plateColour) - 1].dicName;
								this.license.vehicleColour = this.array2[parseInt(this.license.vehicleColour) - 1].dicName;
								this.license.axle = this.array[parseInt(this.license.axle) - 1].dicName;
								this.license.vehicleNature = this.array3[parseInt(this.license.vehicleNature) - 1].dicName;
							}
						}); */
						// }
					}
				} else {
					if (!this.license._plateNum) {
						uni.showToast({
							title: '请输入车牌号！',
							icon: 'none'
						});
					} else if (this.license.plateColour == '请选择') {
						uni.showToast({
							title: '请完善车牌颜色！',
							icon: 'none'
						});
					}
					//  else if (this.license.validPeriod == '请选择') {
					// 	uni.showToast({
					// 		title: '请选择强制报废期！',
					// 		icon: 'none'
					// 	});
					// } 
					// else if(this.license.weightFlag == true && this.license.tqcFlag == true){
					// 	if (!this.license.tqc) {
					// 			uni.showToast({
					// 				title: '请上传从业资格证！',
					// 				icon: 'none'
					// 			});
					// 	}
					
					
					
					// }
					else if (!this.license.insuranceUrl) {
						uni.showToast({
							title: "请上传交强险保险单",
							icon: "none"
						})
						return
					}
					else {
						uni.showToast({
							title: '请完善信息！',
							icon: 'none'
						});
					}
				}
			},
			onBindPickerChange(e) {
				this.index5 = e.target.value
				console.log(this.index5,"this.index5")
				// console.log(this.array5[this.index5],"this.array5[this.index5]")
				this.license.isTractor =this.index5
				// this.license.isTractor = this.array5[this.index5]
			},
			bindDateChange: function(e) {
				this.date = e.detail.value
				console.log(this.date,"this.date")
				this.license.validPeriod = this.date
			},
			getDate(type) {
				const date = new Date();
				let year = date.getFullYear();
				let month = date.getMonth() + 1;
				let day = date.getDate();

				// if (type === 'start') {
				// 	year = year - 60;
				// } else if (type === 'end') {
				// 	year = year + 2;
				// }
				month = month > 9 ? month : '0' + month;
				day = day > 9 ? day : '0' + day;
				return `${year}-${month}-${day}`;
			}
		},
		onLoad: function(options) {
			this.payeeName = options.payeeName;
			this.payeeIdcardNo = options.payeeIdcardNo;
			// this.license.isDefault = options.isDefault;
			this.vehicleId = options.vehicleId;
			this.userInfo = uni.getStorageSync(this.DATA_KEY.userInfo);

			this.wxRequest({
				url: `${this.API}/driverService/queryDic`,
				method: 'POST',
				data: ['VAN_TYPE', 'TRACTOR_TYPE'],
				success: res => {
					this.multiArray.push(res.data.data.TRACTOR_TYPE);
					this.multiArray.push(res.data.data.VAN_TYPE);
				}
			});
			//车轴
			this.wxRequest({
				url: `${this.API}/driverService/queryDic`,
				method: 'POST',
				data: ['AXLE'],
				success: res => {
					this.array = res.data.data.AXLE;
				}
			});
			//车牌颜色
			this.wxRequest({
				url: `${this.API}/driverService/queryDic`,
				method: 'POST',
				data: ['PLATE_COLOR'],
				success: res => {
					this.array1 = res.data.data.PLATE_COLOR;
					console.log('dddd============', this.array1);
				}
			});
			//车辆颜色
			this.wxRequest({
				url: `${this.API}/driverService/queryDic`,
				method: 'POST',
				data: ['VEHICLE_COLOUR'],
				success: res => {
					this.array2 = res.data.data.VEHICLE_COLOUR;
				}
			});
			this.wxRequest({
				url: `${this.API}/driverService/queryDic`,
				method: 'POST',
				data: ['VEHICLE_NATURE'],
				success: res => {
					this.array3 = res.data.data.VEHICLE_NATURE;
				}
			});
			//排放类型
			this.wxRequest({
				url: `${this.API}/driverService/queryDic`,
				method: 'POST',
				data: ['EMISSION_TYPE'],
				success: res => {
					this.array9 = res.data.data.EMISSION_TYPE;
					console.log(this.array9, "this.array9")
				}
			});



			console.log('dddd===============', this.vehicleId);
			if (this.vehicleId != 0) {
				let driver_id = uni.getStorageSync(this.DATA_KEY.userInfo).driverId;
				let etp_id = uni.getStorageSync(this.DATA_KEY.etpId);
				this.wxRequest({
					url: `${this.API}/driverService/getVehicleDetail`,
					method: 'POST',
					data: {
						vehicleId: this.vehicleId,
						etpId: etp_id
					},
					title: '加载中...',
					success: res => {
						this.license = res.data.data;
						this.license._plateNum = this.license._plateNum || this.license.plateNum
						this.license._rtcNo = this.license._rtcNo || this.license.rtcNo
						this.license.uploadDrivingLicenseFlag = this.license.uploadDrivingLicenseFlag || 0
						this.license.uploadDrivingLicenseDeputyFlag = this.license.uploadDrivingLicenseDeputyFlag || 0
						this.license.uploadRtcFlag = this.license.uploadRtcFlag || 0
						this.license.tractorType = this.license.dicValue;
						this.license.vanType = this.license.vanType;
						this.license.vehicleType = this.multiArray[0][this.multiIndex[0]].dicName + ' ' +this.multiArray[1][this.multiIndex[1]].dicName;
						this.license.validPeriod = this.license.validPeriod;
						console.log('===========', parseInt(this.license.plateColour) - 1);
						console.log('===========', this.array1[parseInt(this.license.plateColour) - 1].dicName);
						this.index1 = parseInt(this.license.plateColour) - 1
						this.license.plateColour = this.array1[parseInt(this.license.plateColour) - 1].dicName; //车牌颜色
						this.license.vehicleColour = this.array2[parseInt(this.license.vehicleColour) - 1].dicName;
						// this.license.plateColour.indexOf(this.license.plateColour)
						//车牌赋值颜色
						this.index3 = parseInt(this.license.vehicleNature) - 1 // 车牌性质
						this.license.axle = this.array[parseInt(this.license.axle) - 1].dicName;
						this.license.vehicleNature = this.array3[parseInt(this.license.vehicleNature) - 1].dicName;
						console.log('ddddddddd=============', this.license.trailerInfo, this.license);

						//排放类型
						this.index9 = parseInt(this.license.vehicleNature) - 1 // 排放类型
						this.license.axle = this.array[parseInt(this.license.axle) - 1].dicName;
						this.license.vehicleNature = this.array9[parseInt(this.license.vehicleNature) - 1].dicName;

					}
				});
			}
		}
	};
</script>

<style lang="scss">
	.popup-wrap {
		// padding: 0 24rpx calc(24rpx + env(safe-area-inset-bottom));
		padding: 0 24rpx calc(24rpx);
		color: #007aff;
		text-align: center;
		background: transparent;

		.popup-describe {
			color: #fff;
			position: absolute;
			top: -55vh;
			left: 50%;
			transform: translate(-50%, 0);

			.title {
				margin: 24rpx 0;
				font-size: 36rpx;
			}

			.desc {
				font-size: 24rpx;
			}
		}

		.popup-box {
			background: #fff;
			margin-bottom: 24rpx;
			border-radius: 8rpx;

			view {
				padding: 24rpx 0;

				&:first-child {
					border-bottom: 1rpx solid #f9f9f9;
				}
			}
		}

		.popup-cancel {
			background: #fff;
			padding: 24rpx 0;
			border-radius: 8rpx;
		}
	}

	page {
		background: #ffffff;
	}

	.row-css {
		display: flex;
		flex-direction: row;
	}

	.column-css {
		display: flex;
		flex-direction: column;
	}

	.view-cente {
		background: #ffffff;
		padding: 0 30rpx;
	}

	.view-cente-cle {
		padding: 25rpx 0;
		border-bottom: 1rpx solid #eeeeee;
	}

	.view-cente-cle-text {
		width: 200rpx;
		color: #5f6579;
	}

	.view-button {
		display: flex;
		flex: 1;
		background: #2b7cff;
		border-radius: 5rpx;
		padding: 20rpx;
		margin: 30rpx;
		margin-top: 30rpx;
		justify-content: center;
		color: #ffffff;
	}

	.view-avctib {
		padding: 10rpx;
		background: #f4f4f4;
		color: #999999;
		border-radius: 5rpx;
	}

	.view-avctib-rwst {
		padding: 10rpx;
		background: #2b7cff;
		color: #ffffff;
		border-radius: 5rpx;
	}
	// .sameShow{
	// 	position: absolute;
	// 	top: 50%;
	// 	width: 70%;
	// 	box-sizing: border-box;
	// 	padding: 20rpx;
	// 	margin-left: 15%;
	// 	line-height: 38rpx;
	// 	color: #ffffff;
	// 	border-radius: 10rpx;
	// 	background: rgba(0, 0, 0, 0.6);
	// 	border: 1rpx solid #999999;
	// 	z-index: 50;
	// 	font-size: 26rpx;
	// }
</style>
